home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.4 KB | 55 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 2746442 5-Nov-89 09:10
-
- From: THOUGHT.SHOP Thought Shop, Arvid Jedlicka,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: MacApp Debugger and 'ci'
-
- I hope this is still in time for the "Tacky Patch of the Week" award.
-
- It appears as though the 'ci' implements the 'Debugger' and 'DebugStr' traps
- differently than other Mac's. Both traps have the same address as
- 'Unimplemented' when using NGetTrapAddress or MacsBug, even though the traps
- work. ( How this happens is left as a project for the reader. )
-
- This effects the MacApp debugger. From the debugger, an 'E' will allow you to
- enter MacsBug. Being a robust applicaton ( from Meyer's book ), MacApp checks
- to see that 'DebugStr' is implemented before it makes the call. On the 'ci',
- it looks like the trap is unimplemented, and you get a message 'MacsBug isn't
- available', which is not the real picture.
-
- Another method to determine if a debugger's installed was needed. Checking the
- MacsBug manual, there is a low memory longint variable called MacJmp ( $0120 )
- that holds debugger information. The upper byte has flags, and the lower three
- bytes contain the address of the debugger. Being a 32-bit clean machine, the
- 'ci' seems to have moved the flags somewhere else, but does put what looks like
- an address in the four bytes if a debugger is installed, and nil if it's not.
- On the older 'II' I have, the flags and address appear if installed, and
- $80000000 appears if not installed. I'm not sure if this is caused by the
- difference in ROM's or the difference in system 6.0.3 on the 'II' and 6.0.4 on
- the 'ci'.
-
- Anyway, the following patch was applied to UDebug.inc1.p, procedure DoWaiting.
- As this patch violates several rules ( Patching MacApp source code and Directly
- accessing low memory variables ) I don't recommend it. It's a 'Here's what
- broke, Here's how I fixed it, I'm waiting to hear's what others say' type of
- deal.
-
- 'E':
- BEGIN
- {$IFC FALSE} {Patch}
- IF TrapExists(_DebugStr) THEN {Patch}
- {$ELSEC} {Patch}
- IF ( BAND(Ord4(Handle($00000120)^),$7FFFFFFF) <> 0 ) THEN {Patch}
- {$ENDC} {Patch}
- BEGIN
- ....
- END;
-
- Thanks, Arvid Jedlicka
- The Thought Shop
-
-